

//代理模式
#include <iostream>

//租房类
class RentHouse
{
public:
    virtual void rentHouse()=0;
};

//房东类
class Landlord:public RentHouse
{
    public:
    void rentHouse()
    {
        std::cout<<"将房子租出去"<<std::endl;
    }
};

//中介(代理)
class InterMediary:public RentHouse
{
    public:
    void rentHouse()
    {
        std::cout<<"发布招租启示"<<std::endl;
        std::cout<<"带人看房"<<std::endl;
        _landlord.rentHouse();
        std::cout<<"负责售后维修"<<std::endl;
    }
    private:
    Landlord _landlord;
};

int main()
{
    InterMediary intermediary;
    intermediary.rentHouse();
    return 0;
}